package com.itheima.animal;

public class PolymorphicDemo01 {
    public static void main(String[] args) {
        AnimalOperator animalOperator= new AnimalOperator();
        Cat cat = new Cat();
        Dog dog = new Dog();

        animalOperator.useCat(cat);
        animalOperator.useDog(dog);

        System.out.println("------------------");

        Animal cats = new Cat();
        Animal dogs = new Dog();

        animalOperator.useAnimal(cats);
        animalOperator.useAnimal(dogs);

        System.out.println("------------------");

        animalOperator.useAnimal(cat);
        animalOperator.useAnimal(dog);
    }
}
